function keepsession() {
    var href = document.location.href;
    document.location = href.substring(0, href.indexOf("jsp")) + "jsp?RandStr=" + Math.random();
}

window.setTimeout("keepsession()", 600000);//request the server per 10 mins.